package com.carlinfo.userscenter.users.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.carlinfo.userscenter.stu.pojo.ADynastyEnum;

public class AUsers
{
	private int id;
	private int regionId;
	private String email;
	private String password;
	private String nickName;
	private String trueName;
	private String qq;
	private String phone;
	private Date birthday;
	private int loginCount;
	private int failedCount;
	private Date failedTime;
	private String address;
	private String photoPath;
	private byte emailStatus;
	private byte phoneStatus;
	private byte idcardStatus;
	private byte sex;
	private byte status;
	private Date createTime;
	private Date updateTime;
	private Date lastLoginTime;
	
	/* 定义状态的字符串 */
	private String statusStr;
	private Map<String, ADynastyEnum> statusMap;
	
	public int getId()
	{
		return id;
	}
	public void setId(int id)
	{
		this.id = id;
	}
	public int getRegionId()
	{
		return regionId;
	}
	public void setRegionId(int regionId)
	{
		this.regionId = regionId;
	}
	public String getEmail()
	{
		return email;
	}
	public void setEmail(String email)
	{
		this.email = email;
	}
	public String getPassword()
	{
		return password;
	}
	public void setPassword(String password)
	{
		this.password = password;
	}
	public String getNickName()
	{
		return nickName;
	}
	public void setNickName(String nickName)
	{
		this.nickName = nickName;
	}
	public String getTrueName()
	{
		return trueName;
	}
	public void setTrueName(String trueName)
	{
		this.trueName = trueName;
	}
	public String getQq()
	{
		return qq;
	}
	public void setQq(String qq)
	{
		this.qq = qq;
	}
	public String getPhone()
	{
		return phone;
	}
	public void setPhone(String phone)
	{
		this.phone = phone;
	}
	public Date getBirthday()
	{
		return birthday;
	}
	public void setBirthday(Date birthday)
	{
		this.birthday = birthday;
	}
	public int getLoginCount()
	{
		return loginCount;
	}
	public void setLoginCount(int loginCount)
	{
		this.loginCount = loginCount;
	}
	public int getFailedCount()
	{
		return failedCount;
	}
	public void setFailedCount(int failedCount)
	{
		this.failedCount = failedCount;
	}
	public Date getFailedTime()
	{
		return failedTime;
	}
	public void setFailedTime(Date failedTime)
	{
		this.failedTime = failedTime;
	}
	public String getAddress()
	{
		return address;
	}
	public void setAddress(String address)
	{
		this.address = address;
	}
	public String getPhotoPath()
	{
		return photoPath;
	}
	public void setPhotoPath(String photoPath)
	{
		this.photoPath = photoPath;
	}
	public byte getEmailStatus()
	{
		return emailStatus;
	}
	public void setEmailStatus(byte emailStatus)
	{
		this.emailStatus = emailStatus;
	}
	public byte getPhoneStatus()
	{
		return phoneStatus;
	}
	public void setPhoneStatus(byte phoneStatus)
	{
		this.phoneStatus = phoneStatus;
	}
	public byte getIdcardStatus()
	{
		return idcardStatus;
	}
	public void setIdcardStatus(byte idcardStatus)
	{
		this.idcardStatus = idcardStatus;
	}
	public byte getSex()
	{
		return sex;
	}
	public void setSex(byte sex)
	{
		this.sex = sex;
	}
	public byte getStatus()
	{
		return status;
	}
	public void setStatus(byte status)
	{
		this.status = status;
	}
	public Date getCreateTime()
	{
		return createTime;
	}
	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}
	public Date getUpdateTime()
	{
		return updateTime;
	}
	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}
	public Date getLastLoginTime()
	{
		return lastLoginTime;
	}
	public void setLastLoginTime(Date lastLoginTime)
	{
		this.lastLoginTime = lastLoginTime;
	}
	
	public String getStatusStr()
	{
		ADynastyEnum[] values = ADynastyEnum.values();
		for (ADynastyEnum enumTemp : values)
		{
			if(this.status==enumTemp.getValue() && enumTemp.toString().startsWith("STATUS_"))
			{
				this.statusStr = enumTemp.getInfo();
			}
		}
		return statusStr;
	}
	
	public Map<String, ADynastyEnum> getStatusMap()
	{
		this.statusMap= new TreeMap<String, ADynastyEnum>();
		ADynastyEnum[] values = ADynastyEnum.values();
		for (ADynastyEnum enumTemp : values)
		{
			if(enumTemp.toString().startsWith("STATUS_"))
			{
				this.statusMap.put(enumTemp.getValue()+"", enumTemp);
			}
		}
		return statusMap;
	}

}
